//
//  MenuViewController.m
//  Project_ZFR_MUSIC
//
//  Created by 张福润 on 16/2/24.
//  Copyright © 2016年 张福润. All rights reserved.
//

#import "MenuViewController.h"
#import "AppDelegate.h"
#import "MusicViewController.h"
#import "ReadViewController.h"
@interface MenuViewController ()

@end

@implementation MenuViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    UIButton *music = [UIButton buttonWithType:UIButtonTypeSystem];
    music.tag=101;

    [music setFrame:CGRectMake(50, 200, 100, 50)];
    [music setTitle:@"音乐" forState:UIControlStateNormal];
    [music addTarget:self action:@selector(musicAction) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:music];
    
    UIButton *read = [UIButton buttonWithType:UIButtonTypeSystem];
    read.tag=102;
    [read setFrame:CGRectMake(50, 400, 100, 50)];
    [read setTitle:@"阅读" forState:UIControlStateNormal];
    [read addTarget:self action:@selector(readAction) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:read];
    // Do any additional setup after loading the view.
}
-(void)musicAction{
    
    MusicViewController *music = [[MusicViewController alloc]init];
    UINavigationController *music_na=[[UINavigationController alloc]initWithRootViewController:music];

    AppDelegate *app=[UIApplication sharedApplication].delegate;
    [app.drawer setRootViewController:music_na];
    
    
}

-(void)readAction{
    ReadViewController *read =[[ReadViewController alloc]init];
    UINavigationController *read_na=[[UINavigationController alloc]initWithRootViewController:read];
    AppDelegate *app=[UIApplication sharedApplication].delegate;
    [app.drawer setRootViewController:read_na];
    
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
